import axios from "@/util/request"

export function login(form) {
    return axios({
        url: 'login',
        method: 'POST',
        data: {
            ...form
        }
    })
}

export function saveUser(form) {
    return axios({
        url: 'user',
        method: 'POST',
        data: {
            ...form
        }
    })
}

export function findUserByUsername(username) {
    return axios({
        url: `user?username=${username}`,
        method: 'GET'
    })
}

export function findUserByEmail(email) {
    return axios({
        url: `user?email=${email}`,
        method: 'GET'
    })
}
